package com.example.chat.pojo.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 消息实体
 * </p>
 *
 * @author 林邵晨
 * @since 2023-07-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class MessageVO extends Model<MessageVO> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("消息内容")
    private String content;

    @DateTimeFormat(pattern="HH:mm")
    @JsonFormat(
            pattern = "HH:mm"
    )
    @ApiModelProperty("发送日期")
    private Date date;

    @ApiModelProperty("接收人id")
    private String toUserId;

    @ApiModelProperty("发送人id")
    private String formUserId;

    @ApiModelProperty("消息类型：1 文本, 2 文件")
    private Integer type;

    @ApiModelProperty("逻辑删除：0 未删除, 1 删除")
    private Integer deleted;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("用户唯一标识")
    private String cid;

}
